#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

void solve(){
    int n;
    cin>>n;
    vector<int> arr(2*n);
    for(int i=0;i<2*n;i++){
        cin>>arr[i];
    }
    int l=arr[0];
    for(int i=1;i<2*n;i++){
        if(arr[i]==l)l=-1;
        else if(l==-1)l=arr[i];
    }
    cout<<(l==-1?"Yes":"No")<<endl;
    return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t;
    cin>>t;
    while(t--)solve();

    return 0;
}